bin_PROGRAMS=Tipc_Java_Api_Client Tipc_Java_Api_Server

Tipc_Java_Api_Client_SOURCES=
Tipc_Java_Api_Server_SOURCES=

CLIENT_OBJECTS=com/tipcj/demos/Common.class \
	           com/tipcj/demos/Tipc_Java_Api_Client.class


SERVER_OBJECTS=com/tipcj/demos/Common.class \
	           com/tipcj/demos/Tipc_Java_Api_Server.class

CLEANFILES=$(CLIENT_OBJECTS) $(SERVER_OBJECTS)

Tipc_Java_Api_Client$(EXEEXT): $(CLIENT_OBJECTS)
	$(shell $(MKDIR_P) .libs)
	$(shell cd .libs && jar cfm ../$@.jar ../Manifest_client.txt $(CLIENT_OBJECTS))
	tar cvfz $@.tar.gz $@.jar  -C ../../../tipcj .libs/libtipcj.jar .libs/libtipcj.so
	cp ../../../tipcj/.libs/libtipcj.jar ../../../tipcj/.libs/libtipcj.so .libs

com/tipcj/demos/%.class: %.java
	@echo "Compiling $<"
	$(shell $(MKDIR_P) .libs)
	$(shell javac -cp ../../../tipcj/.libs:.libs -d .libs $< )

Tipc_Java_Api_Server$(EXEEXT): $(SERVER_OBJECTS)
	$(shell $(MKDIR_P) .libs)
	$(shell cd .libs && jar cfm ../$@.jar ../Manifest_server.txt $(SERVER_OBJECTS))
	tar cvfz $@.tar.gz $@.jar -C ../../../tipcj .libs/libtipcj.jar .libs/libtipcj.so
	cp ../../../tipcj/.libs/libtipcj.jar ../../../tipcj/.libs/libtipcj.so .libs

clean-generic:
	rm -rf Tipc_Java_Api_Client$(EXEEXT).jar Tipc_Java_Api_Server$(EXEEXT).jar Tipc_Java_Api_Client$(EXEEXT).tar.gz Tipc_Java_Api_Server$(EXEEXT).tar.gz
